
const Router = require("koa-router");

const router =  new Router();

const db = require("../db");

router.get("/api/detail/:id",async (ctx,next)=>{
        let {id} = ctx.params;
        let data = await db.select(`select * from detail where id=${id}`);
        data[0].imgs = data[0].imgs.split(",");
        ctx.body = {
            code:0,
            data:data[0]
        }
})





module.exports = router;